@mixin chat-header {
    .chat-header {
        width: 100%;
        margin-top: 0.3vw;
        position: relative;

        span {
            font-family: "Alibaba-PuHuiTi-Medium";
            font-size: 1.5416vw;
            letter-spacing: 0.01vw;
        }

        .action {
            position: absolute;
            right: 5vw;
            top: 0px;
            cursor: pointer;
        }
    }
}

.chat-page {
    width: 100%;
    height: 100vh;
    background-image: url("@/assets/img/login_bg.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    position: relative;

    .chat-box {
        width: 90vw;
        height: 80vh;
        background: linear-gradient(180deg, #D224FFAA 0% 23%, #2B5DFFCC 100%);
        // background: linear-gradient(90deg, #FF5DC199 0%, #FF6A6CAA 100%);
        border-radius: 1.2vw;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        box-shadow: 0px 0.52083vw 1.25vw 0px rgba(182, 194, 227, 0.16);
        display: flex;
        box-sizing: border-box;

        // 左侧个人信息区域
        .user-profile {
            width: 15%;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            color: #FAFAFA;
            padding: 1.5vw 0;
            box-sizing: border-box;
            justify-content: space-between;

            .profile {
                display: flex;
                flex-direction: column;
                align-items: center;

                .avatar {
                    width: 3.5vw;
                    height: 3.5vw;
                    border: #DDD 2px solid;
                    border-radius: 50%;
                }

                .username {
                    margin-top: 0.7vw;
                }
            }

            .menu {
                width: 100%;
                margin-bottom: 25%;

                .menu-item {
                    cursor: pointer;
                    height: 60px;
                    line-height: 60px;
                    font-size: 16px;
                    display: flex;
                    align-items: center;
                    padding-left: 15px;
                    box-sizing: border-box;
                    position: relative;

                    .icon {
                        display: flex;
                        align-items: center;
                    }

                    .item-title {
                        margin-left: 5px;
                        font-size: 14px;
                    }
                }

                .act {
                    background: linear-gradient(90deg, #D224FFAA 0% 23%, #D224FF60 100%);

                    &::before {
                        border: #D224FF 2px solid;
                        content: "";
                        position: absolute;
                        left: 0px;
                        bottom: 0px;
                        top: 0px;
                    }
                }

                .menu-item:hover {
                    background: linear-gradient(90deg, #D224FFAA 0% 23%, #D224FF60 100%);

                    &::before {
                        border: #D224FF 2px solid;
                        content: "";
                        position: absolute;
                        left: 0px;
                        bottom: 0px;
                        top: 0px;
                    }
                }
            }
        }

        // 右侧聊天窗口
        .user-chat-frame {
            flex: 1;
            height: 100%;
            border-radius: 1.2vw;
            background: #FAFAFADD;
            padding: 1.2vw;
            box-sizing: border-box;

            // 切换动画效果
            .chat-enter-from,
            .chat-leave-to {
                opacity: 0;
            }

            .chat-enter-active {
                transition: all 0.6s ease-in-out;
            }

            // 最顶部的结构内容
            .frame-header {
                position: relative;
                height: 1vw;

                .tip-msg {
                    position: absolute;
                    right: 1vw;
                    cursor: pointer;
                }
            }

            .chat-frame {
                height: 100%;
                @include chat-header();

                .chat-content {
                    display: flex;
                    justify-content: space-between;

                    .friend-view-area {
                        // background: #FAFAFA;
                        width: 30%;
                        box-sizing: border-box;
                        padding: 0px 0.83333333vw;
                        display: flex;
                        flex-direction: column;
                        align-items: center;

                        .friend-search {
                            padding: 1vw;
                            box-sizing: border-box;
                            width: 100%;

                            .search {
                                ::v-deep .el-input__wrapper {
                                    border-radius: 16px;
                                    box-shadow: unset;
                                }

                                ::v-deep .el-input__wrapper.is-focus {
                                    border: #D224FF 1px solid;
                                }
                            }
                        }

                        .friend-list {
                            max-height: 60vh;
                            overflow-y: auto;
                            scrollbar-width: none;
                            width: 100%;
                            padding: 0.5vw 1vw;
                            box-sizing: border-box;
                            display: flex;
                            flex-direction: column;
                            row-gap: 1vw;
                            font-size: .833333vw;

                            .friend-list-item {
                                cursor: pointer;
                                padding: .5vw 0px;
                                width: 100%;
                                border-radius: 8px;
                                background: #FFF;
                                box-shadow: 1px 3px 5px rgba(182, 194, 227, 0.16);
                                display: flex;
                                align-items: center;
                                transition: all 0.5s ease-in-out;

                                .friend-avatar {
                                    width: 20%;
                                    text-align: center;
                                    height: 3vw;

                                    img {
                                        height: 100%;
                                        border-radius: 50%;
                                    }
                                }

                                .friend-nick {
                                    flex: 1;
                                    padding-left: 5px;
                                    box-sizing: border-box;
                                }

                                .friend-online {
                                    width: 15%;
                                }

                            }
                        }

                        .friend-list-item:hover {
                            transform: scale(1.1);
                            box-shadow: 1px 8px 5px rgba(182, 194, 227, 0.16);
                        }
                    }

                    .chat-window {
                        flex: 1;
                        // background-color: #D224FF60;

                        .chat-window-header {
                            height: 2vw;
                            line-height: 2vw;
                            padding-left: 0.5vw;
                            box-sizing: border-box;
                            background: #FAFAFAFA;
                            border-radius: 8px;
                            margin-bottom: .3vw;

                            .title {
                                font-family: "Alibaba-PuHuiTi-Medium";
                                font-size: 1vw;
                                letter-spacing: 0.01vw;
                            }

                            .tips {
                                font-size: 0.72vw;
                                padding-left: 0.3vw;
                                color:#333333bb;
                            }
                        }

                        .chat-window-box {
                            width: 100%;
                            min-height: 63vh;
                            overflow-y: auto;
                            scrollbar-width: none;
                            position: relative;
                            background: #FAFAFAFA;
                            border-radius: 8px;

                            .chat-list {
                                width: 100%;
                                max-height: calc(62vh - 32px - 1.5vw);
                                // background-color: #D224FF;
                                overflow-y: auto;
                                // scrollbar-width: none;
                                padding: .3vw 1vw;
                                box-sizing: border-box;
                                .chat-list-item{
                                    width: 100%;
                                    display: flex;
                                    // align-items: center;
                                    margin-top: 1.2vw;
                                    .avatar{
                                        width: 3vw;
                                        text-align:center;
                                        img{
                                            width: 2.5vw;
                                            height: 2.5vw;
                                            border-radius: 0.25vw;
                                        }
                                    }
                                    .content-area{
                                        max-width: calc(100% - 11vw);
                                        .item-context{
                                            width: 100%;
                                            // min-height: 2vw;
                                            align-self: baseline;
                                            padding:0.3vw 0.4vw;
                                            font-size: 0.625vw;
                                            line-height: 0.9vw;
                                            word-break: break-all;
                                            box-shadow: 1px 2px 3px rgba(182, 194, 227, 0.36);
                                            border-radius: .3vw;
                                            position: relative;
                                        }
                                        .item-time{
                                            color:#888;
                                            font-size: 0.56vw;
                                            margin-top: 0.2vw;
                                        }
                                    }
                                }
                                .left{
                                    justify-content:flex-start;
                                    .avatar{
                                        order:1;
                                    }

                                    .content-area{
                                        margin-left: 1vw;
                                        order: 2;
                                        .item-context{
                                            background: #F0F0F0DD;
                                            color:#555;
                                        }
                                        .item-context::before{
                                            position: absolute;
                                            content:"";
                                            width: 0px;
                                            border:0.5vw solid;
                                            border-color: transparent;
                                            border-right-color: #F0F0F0DD;
                                            top:0.3vw;
                                            left: -0.95vw;
                                        }
                                    }
                                    
                                }
                                .right{
                                    justify-content: flex-end;
                                    .avatar{
                                        order:2;
                                    }
                                    .content-area{
                                        margin-right: 1.3vw;
                                        order: 1;
                                        .item-context{
                                            background: #D224FFAA;
                                            color:#FFF;
                                        }
                                        .item-context::after{
                                            position: absolute;
                                            content:"";
                                            width: 0px;
                                            border:0.5vw solid;
                                            border-color: transparent;
                                            border-left-color: #D224FFAA;
                                            top:0.3vw;
                                            right: -0.95vw;
                                        }
                                    }
                                    
                                }
                            }

                            // 底部区域发送
                            .input-area {
                                position: absolute;
                                height: calc(32px + 1vw);
                                width: 90%;
                                padding: .5vw 1vw;
                                box-sizing: border-box;
                                left: 5%;
                                bottom: 0.5vw;
                                background: #FFF;
                                border-radius: 10px;
                                box-shadow: 1px 5px 5px rgba(182, 194, 227, 0.36);

                                .enter-inp {
                                    ::v-deep .el-input__wrapper {
                                        // border: unset !important;
                                    }

                                    ::v-deep .el-input__wrapper.is-focus {
                                        border: #D224FF 1px solid !important;
                                        box-shadow: 0 0 0 1px #D224FF !important;
                                    }

                                    .icon {
                                        font-size: 20px;
                                        color: #555;
                                        margin-left: .3vw;
                                        cursor: pointer;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            .setting-frame {
                height: 100%;
                @include chat-header();

                .setting-content {
                    width: 70%;
                    margin: 1vw auto;
                    display: flex;
                    flex-direction: column;
                    // align-items: center;
                    justify-content: center;

                    .user-inp {
                        width: 15vw;

                        ::v-deep .el-input__wrapper {
                            background-color: #FAFAFA88 !important;
                        }

                        ::v-deep .el-input__wrapper.is-focus {
                            box-shadow: 0 0 0 1px #D224FFAA inset !important;
                        }
                    }

                    .ava-img {
                        width: 80px;
                        height: 80px;
                        border: #D224FFAA 1px dashed;
                        border-radius: 5px;
                    }

                    .avatar {
                        width: 80px;
                        height: 80px;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        border: #D224FFAA 1px dashed;
                        border-radius: 5px;
                        overflow: hidden;

                        img {
                            width: 100%;
                            height: 100%;
                            border-radius: 5px;
                        }
                    }

                    .span-icon {
                        display: flex;
                        align-items: center;
                        color: #555;

                        .el-icon {
                            margin-right: 5px;
                        }
                    }

                    .out-btn {
                        width: 200px;
                        height: 40px;
                        background: linear-gradient(90deg, #D224FFAA 0% 23%, #2B5DFFCC 100%);
                        color: #FFF;
                    }
                }
            }
        }
    }
}